﻿<%@ Page Language="C#" Title="路面日常养护单价" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="DF_DailyMainPage.aspx.cs" Inherits="STHPMS1.Web.W_View.Decision.Fondos.DF_DailyMainPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Jquery/ajaxfileupload.js")%>

    <script type="text/javascript">

        function B_RoadwayEdit(flag) {
            var row = $('#dg').datagrid('getSelected');
            var title = "";
            if (flag == 0) {
                if (!row) {
                    $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
                    return;
                }
                $('#fm').form('load', row);
                title = "新增测试数据";
            }
            else {
                $('#fm').form('clear');
                title = "编辑测试数据";
            }

            $('#dlg').dialog('open');
        }
        function search(n, o) {
            var road = $('#cmbRoads').combobox("getValue");

            var url = '/api/dfdailymain';
            var urlParam = "";
            if (road != "" && road != "0") urlParam += "road=" + encodeURI(road) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
        }
        $(function () {
            var number = '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            loadAdmDiv();
            dataGridBind($('#dg'), '/api/dfdailymain', '路面日常养护单价', $('#tb'), number, 30);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

    </script>    

    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <th data-options="field:'Id',editor:'text',width:80,align:'right',hidden:true">ID</th>
            <th data-options="field:'Pvmttype',editor:'numberbox',width:80,align:'right' " formatter="formatPvmttype">路面类型</th>
            <th data-options="field:'Rd_Class',editor:'text',width:180,align:'right' " formatter="formatRoadClassS">公路等级</th>
            <th data-options="field:'Year',editor:'text',width:180,align:'right' " >公路通车年限</th>
            <th data-options="field:'Daily_Unitcost',editor:'text',width:150,align:'right' " formatter="formatNumber">日常养护单价(万元/km）</th>

        </thead>
    </table>
   
    <div id="tb">
       
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="B_RoadwayEdit(0)">编辑</a>
    </div>


    
    <div id="dlg" class="easyui-dialog" title="保存数据" style="width:500px;height:300px;padding:10px" closed="true"  data-options="
				iconCls: 'icon-save',
				buttons: '#dlg-buttons'">
        <form id="fm" method="post" action="/api/dfdailymain">
            <table>		
                 <tr style="display:none">
                    <td>ID:</td>
                    <td><input name='Id' class='easyui-validatebox easyui-textbox'  /></td>
                </tr>	     
                <tr>
                    <td>路面类型:</td>
                    <td><input name='Pvmttype'  class="easyui-combobox"  data-options="readonly:true,prompt:'路面类型',valueField:'id',textField:'text',url:'/api/data/pavement',method:'get' "/></td>
                </tr>
               <tr>
                    <td>技术等级:</td>                    
                    <td><input name='Rd_Class'  class="easyui-combobox"  data-options="readonly:true,prompt:'技术等级',valueField:'id',textField:'text',url:'/api/data/roadclass',method:'get',multiple:true"/></td>
                </tr>
                <tr>
                    <td>公路通车年限:</td>                    
                    <td><input name='Year'  class="easyui-textbox"  data-options="readonly:true,prompt:'公路通车年限'"/></td>
                </tr>
                <tr>
                    <td>日常养护单价:</td>
                    <td><input name='Daily_Unitcost' class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,precision:2"  /></td>
                </tr>
               
		    </table>
        </form>
    </div>

     <div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:sumbitData($('#dg'),$('#dlg'))">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	</div>
    

    
</asp:Content>